<?php


namespace app\common\model;


use think\facade\Request;
use think\Model;

class AdminLoginLog extends Model {

    protected $pk = 'id';

    protected $append = ['admin_name'];

    public function getAdminNameAttr($value,$data){
        return Admin::where('admin_id',$data['admin_id'])->value('admin_name');
    }


    public function getCreatedAtAttr($value,$data){
        if(!empty($value)){
            return date('Y-m-d h:i:s',$value);
        }
    }
}